



        var headSwp;
        var introSwp = new Swiper('.introSwp',{
            direction:'vertical',
            allowTouchMove:false
        })

        var proSwp = new Swiper('.proSwp',{
            direction:'vertical',
            allowTouchMove:false,
        })

        var navSwp = new Swiper('.navSwp',{
            direction:'vertical',
            slidesPerView: 4,
            allowTouchMove:false
        })

        var mecNavSwp = new Swiper('.mecNavSwp',{
            slidesPerView: 'auto',
        })

        var mechanicSwp = new Swiper('.mechanicSwp',{
            speed: 700
        })

        var  newsSwp = new Swiper('.newsSwp',{
            loop:true,
            direction:'vertical',
            slidesPerView: 3
        })
        
        var  proNavSwp = new Swiper('.proNavSwp',{
            loop:true,
            direction:'vertical',
            slidesPerView: 4,
            spaceBetween: 3,
            slideToClickedSlide: true,
        })

        var stopReactScrl = false;
        var breathe = null;

        $(document).ready(function(){
            setTimeout(function(){
                mecNavSwp.update();
            },3000)
            $('main .heading .txtSwitch .control .nums .all')[0].innerText = '0' + $('main .heading .headSwp .swiper-slide').length;
            $('main .heading .txtSwitch .control .process p span')[0].style.width = (1 / $('main .heading .headSwp .swiper-slide').length * 100) + '%';
            $('main .machining .contn .mecNavSwp .swiper-slide').eq(2).addClass('active');
            if(window.innerWidth < 768 && proSwp.params.direction == "vertical"){
                proSwp.changeDirection();
                proSwp.allowTouchMove = true;
            }
            for(var n = 0;n < $('main .comp .contn .sideNav .navSwp .swiper-slide').length;n++){
                $('main .comp .contn .sideNav .navSwp .swiper-slide')[n].ind = n;
            }
            for(var p = 0;p < $('main .pro .contn .txt .proSwp .swiper-slide').length;p++){
                $('main .pro .contn .txt .proSwp .swiper-slide')[p].ind = p;
            }
            
            headSwp = new Swiper('.headSwp',{
                loop:true,
                autoplay:{
                    disableOnInteraction: false
                }
            })

            $('main .heading .txtSwitch .control img').click(function(){
                if($(this)[0].className.indexOf('prev') >= 0){
                    headSwp.slidePrev();
                }else{
                    headSwp.slideNext();
                }
            })
            function updateBg(index,click){
                if(click){
                    $('main .comp .contn .sideNav .navSwp .swiper-slide').removeClass('active');
                    $('main .comp .contn .sideNav .navSwp .swiper-slide').eq(index).addClass('active');
                }else{
                    introSwp.slideTo(index);
                }
                var length = $('main .comp .contn .sideNav .navSwp .swiper-slide').length;
                for(var r = 0;r < length;r++){
                    if(r < index){
                        $('main .comp .picFlip p').eq(length - r - 1).removeClass('active');
                    }else{
                        $('main .comp .picFlip p').eq(length - r - 1).addClass('active');
                    }
                    
                }
            }
            $('main .comp .contn .sideNav .btn').click(function(){
                if($(this)[0].className.indexOf('prev') >= 0){
                    if($('main .comp .contn .sideNav .navSwp .active').prev().length){
                        var last = $('main .comp .contn .sideNav .navSwp .active')[0].ind - 1;
                        updateBg(last,true);
                    }
                    navSwp.slidePrev();
                    introSwp.slidePrev();
                }else{
                    if($('main .comp .contn .sideNav .navSwp .active').next().length){
                        var last = $('main .comp .contn .sideNav .navSwp .active')[0].ind + 1;
                        updateBg(last,true);
                    }
                    navSwp.slideNext();
                    introSwp.slideNext();
                }
            })

            $('main .comp .contn .sideNav .navSwp .swiper-slide').mouseover(function(){
                $('main .comp .contn .sideNav .navSwp .swiper-slide').removeClass('active');
                $(this).addClass('active');
                updateBg($(this).index(),false);
            })
            var updt = false;
            for(var n = 0;n < $('main .news .contn .info .showBox .itm').length;n++){
                $('main .news .contn .info .showBox .itm')[n].ind = n;
            }
            watchBrowse = setInterval(function(){
                var curnt = parseInt($('main .heading .headSwp .swiper-slide-active').attr('data-swiper-slide-index'));
                if(curnt != parseInt($('main .heading .txtSwitch .control .nums .curnt').text()) - 1){
                    //console.log(curnt);
                    if(curnt + 1 < 10){
                        $('main .heading .txtSwitch .control .nums .curnt').text('0' + (curnt + 1));
                    }else{
                        $('main .heading .txtSwitch .control .nums .curnt').text((curnt + 1));
                    }
                    $('main .heading .txtSwitch .control .process p span')[0].style.transform = 'translateX(' + 100 * curnt + '%)';
                    $('main .heading .txtSwitch .txt .itm').removeClass('active');
                    $('main .heading .txtSwitch .txt .itm').eq(curnt).addClass('active');
                }
                if(window.innerWidth >= 768){
                    var newsNow = parseInt($('main .news .newsSwp .swiper-slide-active').attr('data-swiper-slide-index'));
                    if(newsNow != $('main .news .contn .info .showBox .itm.active')[0].ind){
                        $('main .news .contn .info .showBox .itm').removeClass('active');
                        $('main .news .contn .info .showBox .itm').eq(newsNow).addClass('active');
                    }
                    var proNavInd = parseInt($('main .pro .sideNav .proNavSwp .swiper-slide-active').attr('data-id')); 
                    if(proNavInd != $('main .pro .contn .txt .proSwp .swiper-slide-active')[0].ind){
                        console.log(proNavInd);
                        proSwp.slideTo(proNavInd);
                        $('main .pro .contn .proShow .itm').removeClass('active');
                        $('main .pro .contn .proShow .itm').eq(proNavInd).addClass('active');
                        if(proNavInd < 10){
                            $('main .pro .sideNav .num').text('0' + (proNavInd + 1));
                        }else{
                            $('main .pro .sideNav .num').text(proNavInd + 1)
                        }
                    }
                }else{
                    var proInd = $('main .pro .proSwp .swiper-slide-active')[0].ind;
                    if($('main .pro .contn .proShow .itm').eq(proInd)[0].className.indexOf('active') < 0){
                        $('main .pro .contn .proShow .itm').removeClass('active');
                        $('main .pro .contn .proShow .itm').eq(proInd).addClass('active');
                    }
                }
                
                if(backTop && !stopReactScrl && !$('.mobileDevice').length){
                    var scrlTp = document.documentElement.scrollTop || document.body.scrollTop;
                    if(scrlTp >= 40){
                        var val = scrlTp - 20;
                        if(val >= window.innerHeight - 20){
                            $('main .pro .color .red').css('top',(window.innerHeight - 20));
                            $('main .pro').addClass('complete');
                            $('main .pro .contn .txt .ttlBox').width($('main .pro .contn .txt .ttlBox .ttl')[0].offsetWidth);
                            stopReactScrl = true;
                            return false;
                        }
                        $('main .pro .color .red').css('top',(val))
                    }
                }

            },10)

            $(window).scroll(function(){
                if(!updt){
                    updt = true;
                    mecNavSwp.update();
                    proSwp.update();
                }
            })
           
            function updateMechanic(ind){
                mechanicSwp[0].slideTo(ind);
                mechanicSwp[1].slideTo($('main .machining .picFlip .rhtSwp .swiper-slide').length - 1 - ind);
            }
            updateMechanic(2);
            
            $('main .machining .contn .mecNavSwp .swiper-slide').mouseover(function(){
                var index = $(this).index();
                $('main .machining .contn .mecNavSwp .swiper-slide').removeClass('active');
                $(this).addClass('active');
                updateMechanic(index);
            })

            $('main .pro .sideNav .control>*').mouseover(function(){
                $('main .pro .sideNav .control>*').removeClass('active');
                $(this).addClass('active');
            })

            $('main .pro .sideNav .control>*').click(function(){
                if(window.innerWidth >= 768){
                    if($(this)[0].className.indexOf('prev') >= 0){
                        proNavSwp.slidePrev();
                    }else{
                        proNavSwp.slideNext();
                    }
                }else{
                    if($(this)[0].className.indexOf('prev') >= 0){
                        proSwp.slidePrev();
                        console.log('c');
                    }else{
                        proSwp.slideNext();
                    }
                }
                
            })
            var ctLength = $('main .distribution .map div').length;
            breathe = setInterval(function(){
                var rdm = Math.ceil(Math.random() * (ctLength - 1));
                while($('main .distribution .map div').eq(rdm)[0].className.indexOf('brth') >= 0){
                    rdm = Math.ceil(Math.random() * (ctLength - 1))
                }
                $('main .distribution .map div').eq(rdm).addClass('brth');
                setTimeout(function(){
                    $('main .distribution .map div').eq(rdm).removeClass('brth');
                },2000)
            },500)
            /*var cCount = 0;
            for(var c = 0;c < $('main .distribution .map div + p').length;c++){
                cCount += 200;
                $('main .distribution .map div + p').eq(c).find('span')[0].style.transitionDelay = cCount + 'ms';
            }*/
        })
        